* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    box-sizing: border-box;
    width: 100%;
    min-height: 100%;
}

.container {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.12), 0 1.5px 6px rgba(118, 75, 162, 0.08);
    margin: 18px auto;
    width: 100%;
    min-width: 0;
    max-width: 480px;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 20px 18px 20px;
    text-align: center;
    position: relative;
    border-radius: 14px 14px 0 0;
}

.logo {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

.content {
    padding: 22px 18px 18px 18px;
    flex: unset;
    min-height: unset;
    overflow: unset;
}

.feature-section,
.settings-section,
.info-section,
.data-section,
.history-section {
    margin-bottom: 28px;
}

.feature-section h3,
.settings-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    text-align: left;
    background: #f8f9fa;
    color: #333;
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.04);
}

.action-btn.primary {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.action-btn.primary:hover {
    background: linear-gradient(90deg, #5a6fd8 0%, #764ba2 100%);
    transform: translateY(-1px) scale(1.02);
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
}

.action-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-icon {
    margin-right: 10px;
    font-size: 18px;
}

.setting-item {
    margin-bottom: 12px;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-size: 13px;
    color: #666;
}

.status-value {
    font-size: 13px;
    font-weight: 500;
}

.status-value.active {
    color: #28a745;
}

.footer {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 14px 14px;
    min-height: 36px;
    margin-top: 0;
    position: static;
}

.help-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.help-btn:hover {
    color: #5a6fd8;
}

.version {
    font-size: 12px;
    color: #999;
}

/* 响应式设计增强 */
@media (max-width: 480px) {
    html, body, .container {
        max-width: 100vw;
        min-width: 0;
        width: 100vw;
    }
    .content {
        padding: 12px 4vw;
    }
    .header {
        padding: 16px 4vw 12px 4vw;
    }
}

@media (max-width: 350px) {
    html, body, .container {
        min-width: 220px;
    }
}

/* 动画效果 */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.action-btn:active::before {
    width: 300px;
    height: 300px;
}

/* 客户信息展示样式 */
.customer-info {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.status-unknown {
    color: #ffc107;
}

.status-loading {
    color: #007bff;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-ready {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 状态提示样式 */
.status-section {
    margin-bottom: 15px;
}

.status-message {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.status-message.hidden {
    display: none;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-icon {
    margin-right: 8px;
    font-size: 14px;
}

.status-text {
    flex: 1;
}

/* 数据展示样式 */
.data-container,
.history-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    margin-bottom: 6px;
    box-sizing: border-box;
    max-height: unset;
    min-height: unset;
    overflow: unset;
}

.data-placeholder,
.history-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.placeholder-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.data-placeholder p,
.history-placeholder p {
    margin: 0;
    font-size: 13px;
}

/* 订烟数据列表样式 */
.smoking-data-list {
    padding: 0;
}

.data-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.data-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.smoking-item {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    gap: 6px;
}

.smoking-item:last-child {
    border-bottom: none;
}

.smoking-item:hover {
    background-color: #f8f9fa;
}

.smoking-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.smoking-quantity {
    font-size: 12px;
    color: #666;
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.smoking-price {
    font-size: 12px;
    color: #28a745;
    background: #d4edda;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.smoking-total {
    font-size: 12px;
    color: #dc3545;
    background: #f8d7da;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    font-weight: 500;
}

/* 操作历史样式 */
.history-list {
    padding: 0;
}

.history-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    color: #999;
    margin-bottom: 4px;
}

.history-action {
    color: #333;
    font-weight: 500;
}

.history-result {
    color: #666;
    margin-top: 2px;
}

.history-result.success {
    color: #28a745;
}

.history-result.error {
    color: #dc3545;
}

/* 加载状态样式 */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移除滚动条美化相关样式 */
.data-container::-webkit-scrollbar,
.history-container::-webkit-scrollbar,
.data-container::-webkit-scrollbar-thumb,
.history-container::-webkit-scrollbar-thumb,
.data-container::-webkit-scrollbar-thumb:hover,
.history-container::-webkit-scrollbar-thumb:hover {
    display: none;
}